package cn.wusifx.zabbix.request.builder.service;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/service/addtimes
 */
public class ServiceAddTimesRequestBuilder extends CreateRequestBuilder {
    private Integer type;
    private Integer tsFrom;
    private Integer tsTo;
    private String serviceId;
    public ServiceAddTimesRequestBuilder(String auth) {
        super("service.addtimes", auth);
    }

    public ServiceAddTimesRequestBuilder(Long id, String auth) {
        super("service.addtimes", id, auth);
    }

    public Integer getType() {
        return type;
    }

    public ServiceAddTimesRequestBuilder setType(Integer type) {
        this.type = type;
        return this;
    }

    public Integer getTsFrom() {
        return tsFrom;
    }

    public ServiceAddTimesRequestBuilder setTsFrom(Integer tsFrom) {
        this.tsFrom = tsFrom;
        return this;
    }

    public Integer getTsTo() {
        return tsTo;
    }

    public ServiceAddTimesRequestBuilder setTsTo(Integer tsTo) {
        this.tsTo = tsTo;
        return this;
    }

    public String getServiceId() {
        return serviceId;
    }

    public ServiceAddTimesRequestBuilder setServiceId(String serviceId) {
        this.serviceId = serviceId;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("type",type);
        baseRequest.getParams().put("ts_from",tsFrom);
        baseRequest.getParams().put("ts_to",tsTo);
        baseRequest.getParams().put("serviceid",serviceId);
        return baseRequest;
    }
}
